package com.dfbz.demo02_InputStream;

import java.io.FileInputStream;
import java.io.InputStream;

/**
 * @author lscl
 * @version 1.0
 * @intro:
 */
public class Demo03_循环读取单个字符 {
    public static void main(String[] args) throws Exception {
        InputStream is = new FileInputStream("001.txt");

        // 接收我们读取的数据
        int data;

        while ((data = is.read()) != -1) {

            // 代表读取到了有效的数据(没有读取到末尾)
            System.out.println(data);
        }
        is.close();
    }
}
